<%@ page language="java" contentType="text/html; charset=UTF-8"
	isELIgnored="false" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib uri="/mytag" prefix="yjd"%>
<script	src="${requestScope.FPWEB.staticRootPath }/Js/Plugins/Echarts/echarts.min.js"></script>

<div class="wrap">
<div class="J_Chart_Panel">
		<div class="h_a1" style="clear: both;">
			<span class="title">基本数据－性别</span>
			<div class="yjd-tip">
				<div style="width:500px;">
			 1、指定性别注册用户数：在指定的时间段、指定的性别内，有过注册医界贷行为的用户</br>
	         2、指定性别登录用户数：在指定的时间段、指定的性别内，有过登录医界贷行为的用户</br>
	         3、指定性别充值用户数：在指定的时间段、指定的性别内，在医界贷有过充值行为的用户（只包含现金充值）</br>
	         4、指定性别投资用户数：在指定的时间段、指定的性别内，有过投资医界贷行为的用户（含投资“投资项目”、债权转让、小钱包；不含医信宝）
				</div>
			</div>
		</div>
		<form method="post" id="sumary" autocomplete="off" action="${requestScope.FPWEB.rootPath }/sex/getSummary${requestScope.FPWEB.urlStuff}">
			<div class="search_type cc">
				<label>起始时间：</label> <input type="input" max="${now }" name="start" min="${start }"
					class="input length_1 mr10 J_date" value="2013-12-21">
				<label>截止时间：</label> <input type="input" max="${now }" name="end" min="${start }"
					class="input length_1 mr10 J_date" value="${now }">
				<button id="search" type="button" class="btn length_1">搜索</button>
			</div>
		</form>
		<div id="cbox">
		<div id="c1" class="count cc" >
			<div class="c-box" field="register_account">
				<div class="c-box-head">男性注册用户数（人）</div>
				<div class="c-box-con">
					<span name="number" class="number">0</span> 
				</div>
			</div>
			<div class="c-box" field="login_account">
				<div class="c-box-head">男性登录用户数（人）</div>
				<div class="c-box-con">
					<span name="number" class="number">0</span> 
				</div>
			</div>
			<div class="c-box" field="recharge_account">
				<div class="c-box-head">男性充值用户数（人）</div>
				<div class="c-box-con">
					<span name="number" class="number">0</span> 
				</div>
			</div>
			<div class="c-box" field="invest_account">
				<div class="c-box-head">男性投资用户数（人）</div>
				<div class="c-box-con">
					<span name="number" class="number">0</span> 
				</div>
		</div>
	  </div>
	  <div id=c2 class="count cc">
			<div class="c-box" field="register_account">
				<div class="c-box-head">女性注册用户数（人）</div>
				<div class="c-box-con">
					<span name="number" class="number">0</span> 
				</div>
			</div>
			<div class="c-box" field="login_account">
				<div class="c-box-head">女性登录用户数（人）</div>
				<div class="c-box-con">
					<span name="number" class="number">0</span> 
				</div>
			</div>
			<div class="c-box" field="recharge_account">
				<div class="c-box-head">女性充值用户数（人）</div>
				<div class="c-box-con">
					<span name="number" class="number">0</span> 
				</div>
			</div>
			<div class="c-box" field="invest_account">
				<div class="c-box-head">女性投资用户数（人）</div>
				<div class="c-box-con">
					<span name="number" class="number">0</span> 
				</div>
		</div>
		</div>
	  </div>
	</div>
	<li>
	<%@include  file="/WEB-INF/jsp/sex/register.jsp"%>
	<%@include  file="/WEB-INF/jsp/sex/recharge.jsp"%>
	<%@include  file="/WEB-INF/jsp/sex/invest.jsp"%>
	
	<%-- <div class="h_a1" style="clear: both;">
	<span class="title">登录留存率-性别</span>
	<div class="yjd-tip">
		<div style="width:500px;">
        1、登录留存率：某段时间内的新增登录用户，经过一段时间后，仍继续登录的被认作是登录留存用户；该部分用户占当时新增用户的比例即是登录留存率。<br>
		</div>
	</div>
   </div>
	<div class="count cc" style="padding: 0;">
		<form
			action="${requestScope.FPWEB.rootPath }/userKeep/loginRateBysex${requestScope.FPWEB.urlStuff}"
			id="loginRateForm">
			<div class="c-box-head" style="text-align: right;">
				<label>性别：</label> <select name="sex" class="mr10" id="loginSex">
					<option value="1">男</option>
					<option value="2">女</option>
				</select>
				<label>登录留存率:</label> <select name="skip" id="loginSkip">
					<option value="7" selected="selected">过去7天</option>
					<option value="30">过去30天</option>
					<option value="13">过去13周</option>
					<option value="12">过去12个月</option>
				</select>
			</div>
		</form>
		<div class="c-box-con" id="loginRateContiner" style="padding: 0;"></div>
	</div>
  
  <div class="h_a1" style="clear: both;">
	<span class="title">投资留存率-性别</span>
	<div class="yjd-tip">
		<div style="width:500px;">
        1、投资留存率：某段时间内的新增投资用户，经过一段时间后，仍继续投资的被认作是投资留存用户；该部分用户占当时新增用户的比例即是投资留存率。<br>
		</div>
	</div>
   </div>
	<div class="count cc" style="padding: 0;">
		<form
			action="${requestScope.FPWEB.rootPath }/userKeep/investRateBySex${requestScope.FPWEB.urlStuff}"
			id="investRateForm">
			<div class="c-box-head" style="text-align: right;">
			<label>性别：</label> <select name="sex" class="mr10" id="investSex">
					<option value="1">男</option>
					<option value="2">女</option>
				</select>
			<label>投资留存率:</label> <select name="skip" id="investSkip">
					<option value="7" selected="selected">过去7天</option>
					<option value="30">过去30天</option>
					<option value="13">过去13周</option>
					<option value="12">过去12个月</option>
				</select>
			</div>
		</form>
		<div class="c-box-con" id="investRateContiner" style="padding: 0;"></div> --%>
	</div>
	<script>
		YJD.use('AppAdminCommon');
		YJD.use('AppBICommon');
		var form=$("#sumary");
		$("#search").click(function(){
			addCompareData();
		});
		function addCompareData() {
			var cbox=$("#c1");
			var boxes=cbox.find(".c-box");
			boxes.each(
				function(index,e){
					var d=form.serializeArray();
					d.push({
						name:"condition",
						value:1
					});
					d.push({
						name:"field",
						value:$(this).attr('field')
					});
					var it=$(this).find('span[name=number]');
					it.text("Loading...");
					$.ajax({
						type: "post",
						url: form.attr("action"),
						data :d,
						error:function(request){
							alert("连接失败！");
						},
						success:function(data){
							if (data.state == 1) {
								it.text(data.data.summaryVals);
							}
						}
					});
				}		
			);
			var cbox=$("#c2");
			var boxes=cbox.find(".c-box");
			boxes.each(
				function(index,e){
					var d=form.serializeArray();
					d.push({
						name:"condition",
						value:2
					});
					d.push({
						name:"field",
						value:$(this).attr('field')
					});
					var it=$(this).find('span[name=number]');
					it.text("Loading...");
					$.ajax({
						type: "post",
						url: form.attr("action"),
						data :d,
						error:function(request){
							alert("连接失败！");
						},
						success:function(data){
							if (data.state == 1) {
								it.text(data.data.summaryVals);
							}
						}
					});
				}		
			);
			/* $.ajax({
			type: "post",
			url: form.attr("action"),
			data: form.serializeArray(), // 你的formid
			error: function(request) {
				alert("连接失败！");
			},
			success: function(data) {
				if (data.state == 1) {
					var cbox=$("#c1");
					var boxes=cbox.find(".c-box");
					boxes.each(function(index,e){
						var val=$(this).find('span[name=number]');
						val.text(data.data.summaryVals[index]);
					});
				}
			}
		}); */
		}
		addCompareData() ;
		/* 
		function loginRateLoad() {
			var loginRateForm = $("#loginRateForm");
			$.ajax({
				type : "post",
				url : loginRateForm.attr("action"),
				dataType : "html",
				data : loginRateForm.serializeArray(),
				error : function(request) {
					alert("连接失败！");
				},
				success : function(result) {
					$("#loginRateContiner").html(result);
				}
			});
		}
		
		function investRateLoad() {
			var loginRateForm = $("#investRateForm");
			$.ajax({
				type : "post",
				url : loginRateForm.attr("action"),
				dataType : "html",
				data : loginRateForm.serializeArray(),
				error : function(request) {
					alert("连接失败！");
				},
				success : function(result) {
					$("#investRateContiner").html(result);
				}
			});
		}
		

		$(function() {
			loginRateLoad();
			investRateLoad();
			$("#loginSkip").change(function() {
				loginRateLoad();
			});
			$("#investSkip").change(function() {
				investRateLoad();
			});
			$("#loginSex").change(function() {
				loginRateLoad();
			});
			$("#investSex").change(function() {
				investRateLoad();
			});
		}); */
	</script>
</div>